|
![](/i/fill.gif) |
In article <37f865a9@news.povray.org> , Nieminen Juha <war### [at] cc tut fi>
wrote:
> Since each coordinate needs at least 2x16 bits (supposing that we don't
> want to support images greater than 65536x65536 pixels), for an image
> sized, let's say 1024x768 we would need 1024x768x4 bytes = 3 Megabytes.
There are useful pseudo-random number generators out there that don't repeat
numbers until all numbers in the set of produced numbers have been generated
once (sorry, no idea how to put that in nice, short English).
So you wouldn't need to store coordinates. And you can even go with a small
pregenerated (built-in) set of random numbers, say 256 and then repeat that
pattern. It would still be "random" enough. Of course a bitmap to store
which pixels have been rendered can also be used. No need for 3 MB, just
use a better algorithm :-)
> Quite memory consuming, I think. Also accessing 9 Megabytes of memory at
> random is slow...
Compared to a scene that consumes 20 MB and whose data is accessed very
frequently? After all there would be only one memory access (write) per
pixel, not that much after all the accesses needed to generate that pixel!
And it would be stored in a row buffer anyway (also that might still be in
cache).
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |